<style scoped>
.operate-log-data-list /deep/ .el-table th {
  background: #EFF1F8;
  color: #555;
  border-color: #fff;
}
</style>
<!--  -->
<template>
  <div class="operate-log-data-list">
    <el-table ref="multipleTable" :data="dataTable" stripe border  tooltip-effect="dark" style="width: 100%">
      <el-table-column label="语点" align="center" prop="languageId" width="50" :resizable="false">
        <template slot-scope="scope">
          {{languageName(scope.row.languageId)}}
        </template>
      </el-table-column>
      <el-table-column label="操作用户" align="center" prop="username" width="150" :resizable="false">
      </el-table-column>
      <el-table-column label="模块" align="center" prop="modelName" width="120" :resizable="false">
      </el-table-column>
      <el-table-column label="动作" align="center" prop="modelAction" width="180" :resizable="false">
      </el-table-column>
      <el-table-column label="操作内容" prop="content" :resizable="false">
      </el-table-column>
      <el-table-column label="状态" align="center" prop="status" width="80" :resizable="false">
        <template slot-scope="scope">
          <span v-if="scope.row.status === 1">成功</span>
          <span v-else-if="scope.row.status === 0" style="color:#999999;">未执行</span>
          <span v-else-if="scope.row.status === 2" style="color:blue;">执行中</span>
          <span v-else-if="scope.row.status === 3" style="color:orange;">执行失败</span>
          <span v-else-if="scope.row.status === 4" style="color:red;">执行异常</span>
          <span v-else>未定义</span>
        </template>
      </el-table-column>
      <el-table-column label="IP" align="center" prop="ipaddress" width="150" :resizable="false">
      </el-table-column>
      <el-table-column label="操作时间" align="center" prop="createAt" width="160" :resizable="false">
        <template slot-scope="scope">
          {{scope.row.createAt | dateformat}}
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  props: {
    dataTable: {
      type: Array
    }
  },
  computed: {
    ...mapGetters([
      'alllanguage'
    ])
  },
  data () {
    return {
    }
  },
  methods: {
    languageName (id) {
      let lan = this.alllanguage.find(ele => {
        return parseInt(ele.id) === parseInt(id)
      })
      if (!lan) {
        return '未知ID:' + id
      }
      return lan.name
    }
  }
}

</script>
